package com.fun;

import com.thoughtworks.xstream.XStream;

public class TestXStream {
	public static void main(String[] args) {
		Book book = new Book();
		book.setIsbn("XStream");
		book.setName("ding ni ");
		XStream xstream = new XStream();
		xstream.processAnnotations(Book.class);
//		xstream.alias("book", Book.class);
		String xml = xstream.toXML(book);
		System.out.println(xml);
		Book newbook=(Book)xstream.fromXML(xml);
		System.out.println(newbook.getIsbn());
	}
}